package com.apestech.framework.run.modul;

import java.util.Date;

import com.apestech.framework.util.DateUtil;
import com.apestech.framework.util.UnitUtil;

public class RunInfo {
	
	private String name;
	private String errorMsg;
	private long costTime;
	private String costTimeStr="";
	private Date runTime;
	private String runTimeStr="";
	
	public RunInfo(String name, Date runTime, long costTime, String errorMsg){
		this.name=name;
		this.costTime=costTime;
		this.errorMsg=errorMsg;
		this.runTime=runTime;
		if(this.runTime!=null){
			this.runTimeStr=DateUtil.dateTimeToStr(this.runTime);
		}
		this.costTimeStr=UnitUtil.getMinutes(this.costTime);
	}
	
	public String getName() {
		return name;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public long getCostTime() {
		return costTime;
	}

	public String getCostTimeStr() {
		return costTimeStr;
	}
	
	public Date getRunTime() {
		return runTime;
	}

	public String getRunTimeStr() {
		return runTimeStr;
	}

	public String toString(){
		return "{name:"+name+", runTime:"+runTimeStr+", costTime:"+costTimeStr+",errorMsg:"+errorMsg+"}";
	}
}
